package edu.ccut.saturn.basecomponent.dataoperationcomponent;

import java.util.List;

import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IParameterContext;
import edu.ccut.saturn.component.SaturnData;

public class GetFirstSaturnDataFromList extends DefaultComponent {
	@SuppressWarnings("unchecked")
	@Override
	public void execute(IParameterContext parameterContext) throws Exception {
		List<SaturnData> list = (List<SaturnData>)parameterContext.getParameterValue(0);
		if(list!=null&&list.size()>0){
			parameterContext.setParameter(1, (SaturnData)list.get(0));
		}else{
			parameterContext.setParameter(1, null);
		}
	}
}